package com.Java.train.business.controller;

import com.Java.train.common.response.CommonResp;
import com.Java.train.business.entity.DTO.SkTokenDTO;
import com.Java.train.business.req.SkTokenQueryReq;
import com.Java.train.common.response.PageResp;
import com.Java.train.business.entity.SkToken;
import com.Java.train.business.service.SkTokenService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import java.util.List;
/**
* @author luomoxingchen
* @since 2024-10-19
*/
@RestController
@RequestMapping("/admin/sk-token")
public class SkTokenController {

    @Autowired
    private SkTokenService skTokenService;


    @GetMapping("/query-list")
    @ApiOperation("SkToken查询全部")
    public CommonResp<PageResp<SkTokenDTO>> queryList(@Valid SkTokenQueryReq skTokenQueryReq){
        PageResp<SkTokenDTO> list = skTokenService.queryList(skTokenQueryReq);
        return new CommonResp<>(list);
    }

    @PostMapping("/save")
    @ApiOperation("SkToken修改")
    public CommonResp<Object> update(@Valid @RequestBody SkToken skToken) {
        return skTokenService.modify(skToken);
    }


}
